package com.fuyun.rpc.dto;

import cn.hutool.core.util.StrUtil;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @Author fuyun。
 * @Date 2025/8/21 15:52。
 * @Description: TODO。
 **/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class RpcReq implements Serializable {
    private String requestId;
    private String interfaceName;
    private String methodName;
    private Object[] params;
    private Class<?>[] parameterTypes;
    private String version;
    private String group;

    public String rpcServerName() {
        return getInterfaceName()
                + StrUtil.blankToDefault(getVersion(), StrUtil.EMPTY)
                + StrUtil.blankToDefault(getGroup(), StrUtil.EMPTY);
    }

}
